/**
 * Copyright:Copyright(c)2014-2017
 * Company:厦门市易致达物联网科技有限公司
 * @version 1.0
 */
package shop.controller.front.store;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import shop.core.FrontBaseController;
import shop.core.Services;
import shop.core.common.bean.JSONResult;
import shop.core.common.dao.page.PagerModel;
import shop.services.front.store.StoreService;
import shop.services.front.store.bean.Store;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**   
 * @类名称：StoreController
 * @创建人：Wzl
 * @创建时间：2018-01-03 下午16:50:06      
 * @版本号：1.0
 * @描述：     
 */
@Controller
@RequestMapping("/front/store/")
public class StoreController extends FrontBaseController<Store> {
    @Resource
    private StoreService storeService;
    @Override
    public Services<Store> getService() {
        return storeService;
    }

    /**
     * 查询店铺列表
     *
     * @return
     * @throws Exception
     */
    @RequestMapping("selectStoreList")
    @ResponseBody
    public JSONResult selectStoreList(Store store){
        List<Store> storeList = storeService.selectStoreList(store);
        JSONResult jsonResult = new JSONResult();
        jsonResult.setData(storeList);
        return jsonResult;
    }

    /**
     * 查询店铺详情
     * @param store
     * @return
     */
    @RequestMapping(value = "selectStoreDetail")
    @ResponseBody
    public JSONResult selectStoreDetail(Store store) {
        store =  storeService.selectOne(store);
        JSONResult jsonResult = new JSONResult();
        jsonResult.setData(store);
        return jsonResult;
    }

    @Override
    public JSONResult insertJson(HttpServletRequest request, Store store) throws Exception {
        return null;
    }

    @Override
    public JSONResult updateJson(HttpServletRequest request, Store store) throws Exception {
        return null;
    }

    @Override
    public JSONResult deleteJson(HttpServletRequest request, Store store) throws Exception {
        return null;
    }
}
